package com.kaifamiao.www.IP.do0928;

import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.InetAddress;

public class GroupSend {
    public static void main(String[] args) throws Exception{

        DatagramSocket socket = new DatagramSocket();
        InetAddress address = InetAddress.getByName("224.0.1.0");
        int port = 8888;
        String str = "组播组播 树脂666";
        byte[] bytes = str.getBytes();
        DatagramPacket packet = new DatagramPacket(bytes,bytes.length,address,port);
        socket.send(packet);

//        socket.close();
        System.out.println("发送完毕");
        socket.close();
    }
}
